import Fluent

struct CreateMessage: Migration {
    
    func prepare(on database: Database) -> EventLoopFuture<Void> {
        database.schema("messages")
            .id()
            .field("toAbbreviation", .string)
            .field("fromAbbreviation", .string)
            .field("messageTitle", .string)
            .field("messageContent", .string)
            .field("messageType", .int16)
            .field("isSeen", .bool)
            .field("sendDateTime", .string)
            .field("seenDateTime", .string)
            .field("isHighPriority", .bool)
            .field("linkedTo", .string)
            .field("additionalInformation", .string)
            .create()
    }
    
    func revert(on database: Database) -> EventLoopFuture<Void> {
        database.schema("users").delete()
    }
}
